<?php
namespace AdminApi\Controller;
use Zend\Mvc\Controller\AbstractRestfulController;
use Zend\View\Model\JsonModel;
class TotalUsersApiController extends AbstractRestfulController
{
    public function getList()
    {			
		header('Access-Control-Allow-Origin: *');
		$request = $this->getRequest();
		$headers = $request->getHeaders();
		$userTable=$this->getServiceLocator()->get('Models\Model\UserFactory');
		$users_cnt=0;
		$shop_users_cnt=0;
		$shop_users_cnt = $userTable->cntShopsAndUsers('shop_users');
		$users_cnt = $userTable->cntShopsAndUsers('users');
		if($shop_users_cnt!=0 || $users_cnt!=0){
			return new JsonModel(array(
				'shopusers' => $shop_users_cnt,
				'users' => $users_cnt,
			));
		}else{
			return new JsonModel(array(
				'output' => 'no data',
			));
		}
    }
    public function get($user_id)
    {		
		
    }
    public function create($data)
    {
		
    }
    public function update($data,$uid )
    {
		
    }
    public function delete($id)
    {
       
    }
}